home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 22 / Cream of the Crop 22.iso / games / tmloto13.zip / MAX.MH < prev    next >
Text File  |  1996-10-14  |  33KB  |  877 lines

  1. //////////////////////////////////////////////////////////////////////////////
  2. //
  3. // File: max.mh
  4. //
  5. // Desc: MEX include file for Maximus.  This must be included by all MEX
  6. //       programs that interface with Maximus routines.
  7. //
  8. // Copyright 1990, 1994 by Lanius Corporation.  All rights reserved.
  9. //
  10. // $Id: max.mh 1.17 1995/07/15 14:50:23 sjd Exp $
  11. //
  12. //////////////////////////////////////////////////////////////////////////////
  13.  
  14. // Boolean type definitions
  15.  
  16. #define TRUE   1
  17. #define FALSE  0
  18.  
  19. // Common
  20.  
  21. #define True              1
  22. #define False             0
  23.  
  24. // Query types for class_info()
  25.  
  26. #define CIT_NUMCLASSES    -1
  27. #define CIT_DAY_TIME      0
  28. #define CIT_CALL_TIME     1
  29. #define CIT_DL_LIMIT      2
  30. #define CIT_RATIO         3
  31. #define CIT_MIN_BAUD      4
  32. #define CIT_MIN_XFER_BAUD 5
  33. #define CIT_MAX_CALLS     6
  34. #define CIT_FREE_RATIO    7
  35. #define CIT_UPLOAD_REWARD 8
  36. #define CIT_ACCESSFLAGS   9
  37. #define CIT_MAILFLAGS     10
  38. #define CIT_USERFLAGS     11
  39. #define CIT_LEVEL         12
  40. #define CIT_CLASSKEY      13
  41.  
  42. #define CIT_BYINDEX       32768     // OR with type to search by class index
  43.  
  44. // Types for input_str():
  45.  
  46. // One of the following three options must be used:
  47. #define INPUT_LB_LINE     0x0001 // Input a line, allowing stacked input
  48. #define INPUT_NLB_LINE    0x0002 // Input a line, not allowing stacked input
  49. #define INPUT_WORD        0x0004 // Input a word, allowing stacked input
  50.  
  51. // Any of the following options can also be specified:
  52. #define INPUT_ECHO        0x0008 // The character in 'ch' should be echoed
  53.                                  // back to user, instead of the character
  54.                                  // actually typed.
  55.  
  56. #define INPUT_ALREADYCH   0x0010 // The character in 'ch' was already typed
  57.                                  // by the user and should be inserted at
  58.                                  // the beginning of the string.
  59. #define INPUT_SCAN        0x0020 // Allow scan codes to be placed in string
  60. #define INPUT_NOCTRLC     0x0040 // Don't allow user to ^C to redisplay prompt
  61. #define INPUT_RSVD1       0x0080 // Reserved
  62. #define INPUT_NOLF        0x0100 // Don't send an LF at end of input function
  63. #define INPUT_RSVD2       0x0200 // Reserved
  64. #define INPUT_WORDWRAP    0x0400 // Permit word-wrapping
  65. #define INPUT_NOCLEOL     0x0800 // Never issue CLEOL codes
  66. #define INPUT_DEFAULT     0x1000 // Pretend that the current contents of
  67.                                  // string 's' were already entered by
  68.                                  // the user.
  69. #define INPUT_NOECHO      0x2000 // Disable input echo
  70.  
  71. // Types for input_ch() and input_list():
  72.  
  73. #define CINPUT_DISPLAY    0x0001 // Always display the character entered
  74.                                  // by the user, even if in hotkey mode.
  75. #define CINPUT_RTNHELP    0x0001 // Valid only for GetListAnswer()
  76.                                  // Returns to caller if 'help' key after
  77.                                  // displaying the help file
  78. #define CINPUT_ACCEPTABLE 0x0002 // 'options' specifies a string of acceptable
  79.                                  // characters.  The char entered by the user
  80.                                  // must be contained in that string.
  81. #define CINPUT_PROMPT     0x0004 // Display the prompt in 'options' before
  82.                                  // trying to get the character.
  83. #define CINPUT_RESERVED1  0x0008 // Reserved
  84. #define CINPUT_SCAN       0x0010 // Return scan codes, if applicable
  85. #define CINPUT_NOXLT      0x0020 // Don't translate special characters,
  86.                                  // such as \r and \n, into their ASCII
  87.                                  // equivilents.  (For example, <enter>
  88.                                  // will be returned as '\r' with this
  89.                                  // option, instead of '|'.)
  90. #define CINPUT_NOCTRLC    0x0040 // Don't allow user to ^C to dump output
  91.                                  // and redisplay prompt.
  92. #define CINPUT_P_CTRLC    0x0080 // Only display prompt in 'options' if
  93.                                  // user presses ^C
  94. #define CINPUT_NOLF       0x0100 // Don't display LF at end of input function
  95. #define CINPUT_FULLPROMPT 0x0200 // input_list only:  do not add
  96.                                  // a bracketed list of acceptable chars
  97.                                  // to the end of the prompt string.
  98.                                  // (eg. "[a,b,c,d,?]")
  99. #define CINPUT_ALLANSWERS 0x0400 // Allow the user to exit by pressing <cr>
  100.                                  // only
  101. #define CINPUT_DUMP       0x0800 // Flush output buffer when we get a character
  102. #define CINPUT_RESERVED2  0x1000 // Reserved
  103. #define CINPUT_NOUPPER    0x2000 // Don't convert input char to uppercase
  104. #define CINPUT_AUTOP      0x4000 // Display prompt even if user has hotkeys
  105.                                  // enabled
  106. #define CINPUT_ANY        0x8000 // input_list only:  any response allowed,
  107.                                  // even if not contained in 'list'
  108.  
  109. // Constants for class_info(CIT_MAILFLAGS)
  110.  
  111. #define CFLAGM_PVT      0x01000000              /* Show private messages */
  112. #define CFLAGM_EDITOR   0x02000000             /* External editor access */
  113. #define CFLAGM_LEDITOR  0x04000000       /* Local external editor access */
  114. #define CFLAGM_NETFREE  0x08000000                  /* Netmail is 'free' */
  115. #define CFLAGM_ATTRANY  0x10000000  /* Allow 'sysop' attribute overrides */
  116. #define CFLAGM_RDONLYOK 0x40000000  /* Allow write priv in readonly area */
  117. #define CFLAGM_NOREALNM 0x80000000       /* Don't add ^aREALNAME to msgs */
  118.  
  119. // Constants for class_info(CIT_ACCESSFLAGS)
  120.  
  121. #define CFLAGA_ULBBSOK  0x00000001         /* Uploading .?bs files is ok */
  122. #define CFLAGA_FLIST    0x00000002  /* Allow file dloads not in filelist */
  123. #define CFLAGA_FHIDDEN  0x00000004        /* See/download 'hidden' files */
  124. #define CFLAGA_UHIDDEN  0x00000008  /* Allow 'not in userlist' user view */
  125. #define CFLAGA_HIDDEN   0x00000010           /* Always hide in user list */
  126. #define CFLAGA_HANGUP   0x00000020                 /* Hangup immediately */
  127. #define CFLAGA_NOLIMIT  0x00000040           /* Don't check dload limits */
  128. #define CFLAGA_NOTIME   0x00000080            /* Don't check time limits */
  129.  
  130.  
  131.  
  132. // Various constants for the user record:
  133.  
  134. // usr.help
  135. #define HELP_NOVICE     6
  136. #define HELP_REGULAR    4
  137. #define HELP_EXPERT     2
  138.  
  139. // usr.video
  140. #define VIDEO_TTY       0
  141. #define VIDEO_ANSI      1
  142. #define VIDEO_AVATAR    2
  143.  
  144. // usr.sex
  145. #define SEX_UNKNOWN     0
  146. #define SEX_MALE        1
  147. #define SEX_FEMALE      2
  148.  
  149. // usr.def_proto
  150. //
  151. // Positive numbers indicate external protocols.
  152.  
  153. #define PROTOCOL_NONE        (char)(-1)
  154. #define PROTOCOL_XMODEM      (char)(-2)
  155. #define PROTOCOL_YMODEM      (char)(-3)
  156. #define PROTOCOL_XMODEM1K    (char)(-4)
  157. #define PROTOCOL_SEALINK     (char)(-5)
  158. #define PROTOCOL_ZMODEM      (char)(-6)
  159. #define PROTOCOL_YMODEMG     (char)(-7)
  160.  
  161. // Constants for tag_queue_file()
  162.  
  163. #define FFLAG_NOTIME    0x0004
  164. #define FFLAG_NOBYTES   0x0008
  165. #define FFLAG_STAGE     0x0400
  166. #define FFLAG_SLOW      0x0800
  167.  
  168. // Constants for open()
  169.  
  170. #define IOPEN_CREATE    0x01
  171. #define IOPEN_READ      0x02
  172. #define IOPEN_WRITE     0x04
  173. #define IOPEN_RW        0x06
  174. #define IOPEN_APPEND    0x08
  175. #define IOPEN_BINARY    0x80
  176.  
  177. // Constants for seek().where
  178.  
  179. #define SEEK_SET        0
  180. #define SEEK_CUR        1
  181. #define SEEK_END        2
  182.  
  183. // Constants for shell()
  184.  
  185. #define IOUTSIDE_RUN      0x01
  186. #define IOUTSIDE_DOS      0x02
  187. #define IOUTSIDE_REREAD   0x04
  188.  
  189. // Strings to be included as part of print() output to change screen attributes
  190.  
  191. #define COL_BLACK               "\x16\x01\x00"
  192. #define COL_BLUE                "\x16\x01\x01"
  193. #define COL_GREEN               "\x16\x01\x02"
  194. #define COL_CYAN                "\x16\x01\x03"
  195. #define COL_RED                 "\x16\x01\x04"
  196. #define COL_MAGENTA             "\x16\x01\x05"
  197. #define COL_BROWN               "\x16\x01\x06"
  198. #define COL_GRAY                "\x16\x01\x07"
  199. #define COL_DKGRAY              "\x16\x01\x08"
  200. #define COL_LBLUE               "\x16\x01\x09"
  201. #define COL_LGREEN              "\x16\x01\x0a"
  202. #define COL_LCYAN               "\x16\x01\x0b"
  203. #define COL_LRED                "\x16\x01\x0c"
  204. #define COL_LMAGENTA            "\x16\x01\x0d"
  205. #define COL_YELLOW              "\x16\x01\x0e"
  206. #define COL_WHITE               "\x16\x01\x0f"
  207. #define COL_YELLOWONBLUE        "\x16\x01\x1e"
  208. #define COL_BLACKONGREEN        "\x16\x01\x20"
  209. #define COL_REDONGREEN          "\x16\x01\x2c"
  210. #define COL_WHITEONGREEN        "\x16\x01\x2f"
  211.  
  212. // Colour Combinations - Extended
  213.  
  214.    // Colour on Black
  215. #define  COL_BLKONBLK     "\x16\x01\x10\x80"
  216. #define  COL_BLUONBLK     "\x16\x01\x10\x81"
  217. #define  COL_GRNONBLK     "\x16\x01\x10\x82"
  218. #define  COL_CYNONBLK     "\x16\x01\x10\x83"
  219. #define  COL_REDONBLK     "\x16\x01\x10\x84"
  220. #define  COL_MGNONBLK     "\x16\x01\x10\x85"
  221. #define  COL_BRNONBLK     "\x16\x01\x10\x86"
  222. #define  COL_DGRYONBLK    "\x16\x01\x10\x88"
  223. #define  COL_LBLUONBLK    "\x16\x01\x10\x89"
  224. #define  COL_LGRNONBLK    "\x16\x01\x10\x8A"
  225. #define  COL_LCYNONBLK    "\x16\x01\x10\x8B"
  226. #define  COL_LREDONBLK    "\x16\x01\x10\x8C"
  227. #define  COL_LMGNONBLK    "\x16\x01\x10\x8D"
  228. #define  COL_YLWONBLK     "\x16\x01\x10\x8E"
  229.    // Colour on Blue
  230. #define  COL_BLKONBLU     "\x16\x01\x10\x90"
  231. #define  COL_BLUONBLU     "\x16\x01\x10\x91"
  232. #define  COL_GRNONBLU     "\x16\x01\x10\x92"
  233. #define  COL_CYNONBLU     "\x16\x01\x10\x93"
  234. #define  COL_REDONBLU     "\x16\x01\x10\x94"
  235. #define  COL_MGNONBLU     "\x16\x01\x10\x95"
  236. #define  COL_BRNONBLU     "\x16\x01\x10\x96"
  237. #define  COL_DGRYONBLU    "\x16\x01\x10\x98"
  238. #define  COL_LBLUONBLU    "\x16\x01\x10\x99"
  239. #define  COL_LGRNONBLU    "\x16\x01\x10\x9A"
  240. #define  COL_LCYNONBLU    "\x16\x01\x10\x9B"
  241. #define  COL_LREDONBLU    "\x16\x01\x10\x9C"
  242. #define  COL_LMGNONBLU    "\x16\x01\x10\x9D"
  243. #define  COL_YLWONBLU     "\x16\x01\x1e"
  244. #define  COL_WHTONBLU     "\x16\x01\x10\x9F"
  245.    // Colour on Green
  246. #define  COL_BLKONGRN     "\x16\x01\x20"
  247. #define  COL_BLUONGRN     "\x16\x01\x21"
  248. #define  COL_GRNONGRN     "\x16\x01\x22"
  249. #define  COL_CYNONGRN     "\x16\x01\x23"
  250. #define  COL_MGNONGRN     "\x16\x01\x25"
  251. #define  COL_BRNONGRN     "\x16\x01\x26"
  252. #define  COL_GRYONGRN     "\x16\x01\x27"
  253. #define  COL_DGRYONGRN    "\x16\x01\x28"
  254. #define  COL_LBLUONGRN    "\x16\x01\x29"
  255. #define  COL_LGRNONGRN    "\x16\x01\x2A"
  256. #define  COL_LCYNONGRN    "\x16\x01\x2B"
  257. #define  COL_LREDONGRN    "\x16\x01\x2C"
  258. #define  COL_REDONGRN     "\x16\x01\x2c"
  259. #define  COL_LMGNONGRN    "\x16\x01\x2D"
  260. #define  COL_YLWONGRN     "\x16\x01\x2E"
  261. #define  COL_WHTONGRN     "\x16\x01\x2f"
  262.    // Colour on Cyan
  263. #define  COL_BLKONCYN     "\x16\x01\x30"
  264. #define  COL_BLUONCYN     "\x16\x01\x31"
  265. #define  COL_GRNONCYN     "\x16\x01\x32"
  266. #define  COL_CYNONCYN     "\x16\x01\x33"
  267. #define  COL_REDONCYN     "\x16\x01\x34"
  268. #define  COL_MGNONCYN     "\x16\x01\x35"
  269. #define  COL_BRNONCYN     "\x16\x01\x36"
  270. #define  COL_GRYONCYN     "\x16\x01\x37"
  271. #define  COL_DGRYONCYN    "\x16\x01\x38"
  272. #define  COL_LBLUONCYN    "\x16\x01\x39"
  273. #define  COL_LGRNONCYN    "\x16\x01\x3A"
  274. #define  COL_LCYNONCYN    "\x16\x01\x3B"
  275. #define  COL_LREDONCYN    "\x16\x01\x3C"
  276. #define  COL_LMGNONCYN    "\x16\x01\x3D"
  277. #define  COL_YLWONCYN     "\x16\x01\x3E"
  278. #define  COL_WHTONCYN     "\x16\x01\x3F"
  279.    // Colour on Red
  280. #define  COL_BLKONRED     "\x16\x01\x40"
  281. #define  COL_BLUONRED     "\x16\x01\x41"
  282. #define  COL_GRNONRED     "\x16\x01\x42"
  283. #define  COL_CYNONRED     "\x16\x01\x43"
  284. #define  COL_REDONRED     "\x16\x01\x44"
  285. #define  COL_MGNONRED     "\x16\x01\x45"
  286. #define  COL_BRNONRED     "\x16\x01\x46"
  287. #define  COL_GRYONRED     "\x16\x01\x47"
  288. #define  COL_DGRYONRED    "\x16\x01\x48"
  289. #define  COL_LBLUONRED    "\x16\x01\x49"
  290. #define  COL_LGRNONRED    "\x16\x01\x4A"
  291. #define  COL_LCYNONRED    "\x16\x01\x4B"
  292. #define  COL_LREDONRED    "\x16\x01\x4C"
  293. #define  COL_LMGNONRED    "\x16\x01\x4D"
  294. #define  COL_YLWONRED     "\x16\x01\x4E"
  295. #define  COL_WHTONRED     "\x16\x01\x4F"
  296.    // Colour on Magenta
  297. #define  COL_BLKONMGN     "\x16\x01\x50"
  298. #define  COL_BLUONMGN     "\x16\x01\x51"
  299. #define  COL_GRNONMGN     "\x16\x01\x52"
  300. #define  COL_CYNONMGN     "\x16\x01\x53"
  301. #define  COL_REDONMGN     "\x16\x01\x54"
  302. #define  COL_MGNONMGN     "\x16\x01\x55"
  303. #define  COL_BRNONMGN     "\x16\x01\x56"
  304. #define  COL_GRYONMGN     "\x16\x01\x57"
  305. #define  COL_DGRYONMGN    "\x16\x01\x58"
  306. #define  COL_LBLUONMGN    "\x16\x01\x59"
  307. #define  COL_LGRNONMGN    "\x16\x01\x5A"
  308. #define  COL_LCYNONMGN    "\x16\x01\x5B"
  309. #define  COL_LREDONMGN    "\x16\x01\x5C"
  310. #define  COL_LMGNONMGN    "\x16\x01\x5D"
  311. #define  COL_YLWONMGN     "\x16\x01\x5E"
  312. #define  COL_WHTONMGN     "\x16\x01\x5F"
  313.    // Colour on Brown
  314. #define  COL_BLKONBRN     "\x16\x01\x60"
  315. #define  COL_BLUONBRN     "\x16\x01\x61"
  316. #define  COL_GRNONBRN     "\x16\x01\x62"
  317. #define  COL_CYNONBRN     "\x16\x01\x63"
  318. #define  COL_REDONBRN     "\x16\x01\x64"
  319. #define  COL_MGNONBRN     "\x16\x01\x65"
  320. #define  COL_BRNONBRN     "\x16\x01\x66"
  321. #define  COL_GRYONBRN     "\x16\x01\x67"
  322. #define  COL_DGRYONBRN    "\x16\x01\x68"
  323. #define  COL_LBLUONBRN    "\x16\x01\x69"
  324. #define  COL_LGRNONBRN    "\x16\x01\x6A"
  325. #define  COL_LCYNONBRN    "\x16\x01\x6B"
  326. #define  COL_LREDONBRN    "\x16\x01\x6C"
  327. #define  COL_LMGNONBRN    "\x16\x01\x6D"
  328. #define  COL_YLWONBRN     "\x16\x01\x6E"
  329. #define  COL_WHTONBRN     "\x16\x01\x6F"
  330.    // Colour on Gray
  331. #define  COL_BLKONGRY     "\x16\x01\x70"
  332. #define  COL_BLUONGRY     "\x16\x01\x71"
  333. #define  COL_GRNONGRY     "\x16\x01\x72"
  334. #define  COL_CYNONGRY     "\x16\x01\x73"
  335. #define  COL_REDONGRY     "\x16\x01\x74"
  336. #define  COL_MGNONGRY     "\x16\x01\x75"
  337. #define  COL_BRNONGRY     "\x16\x01\x76"
  338. #define  COL_GRYONGRY     "\x16\x01\x77"
  339. #define  COL_DGRYONGRY    "\x16\x01\x78"
  340. #define  COL_LBLUONGRY    "\x16\x01\x79"
  341. #define  COL_LGRNONGRY    "\x16\x01\x7A"
  342. #define  COL_LCYNONGRY    "\x16\x01\x7B"
  343. #define  COL_LREDONGRY    "\x16\x01\x7C"
  344. #define  COL_LMGNONGRY    "\x16\x01\x7D"
  345. #define  COL_YLWONGRY     "\x16\x01\x7E"
  346. #define  COL_WHTONGRY     "\x16\x01\x7F"
  347.  
  348.  
  349. #define AVATAR_ATTR             "\x16\x01"
  350. #define AVATAR_BLINK            "\x16\x02"
  351. #define AVATAR_UP               "\x16\x03"
  352. #define AVATAR_DOWN             "\x16\x04"
  353. #define AVATAR_LEFT             "\x16\x05"
  354. #define AVATAR_RIGHT            "\x16\x06"
  355. #define AVATAR_CLEOL            "\x16\x07"
  356. #define AVATAR_GOTO             "\x16\x08"
  357. #define AVATAR_CLS              "\x0c"
  358. #define AVATAR_RPTCHAR          "\x19"
  359. #define AVATAR_RPTSEQ           "\x17\x19"
  360.  
  361. struct _date                    // Date structure
  362. {
  363.   char: day;                    // Day of month.   1 = first of month
  364.   char: month;                  // Month of year.  1 = January
  365.   char: year;                   // Year - 1980.    0 = 1980
  366. };
  367.  
  368. struct _time                    // Time structure
  369. {
  370.   char: hh;                     // Hour
  371.   char: mm;                     // Minute
  372.   char: ss;                     // Second
  373. };
  374.  
  375.  
  376. struct _stamp                   // Date and time structure
  377. {
  378.   struct _date: date;
  379.   struct _time: time;
  380. };
  381.  
  382.  
  383. struct _cstat                   // Chat status of a particular user
  384. {
  385.     int: task_num;              // User's node number.
  386.     int: avail;                 // Available for chat?
  387.     string: username;           // User's name
  388.     string: status;             // User's status
  389. };
  390.  
  391. struct _sys                     // System information
  392. {
  393.    int: current_row;            // Cursor's row position (1=top)
  394.    int: current_col;            // Cursor's column position (1=left)
  395.    int: more_lines;             // # of lines displayed since last More[Y,n]
  396. };
  397.  
  398. struct _msg                     // Information about current message
  399. {
  400.   long: current;                // Current message number
  401.   long: high;                   // Highest message number
  402.   long: num;                    // Number of messages in area
  403.   int:  direction;              // Reading direction (1==next, 0==prior)
  404. };
  405.  
  406. // For marea.attribs:
  407.  
  408. #define MA_PVT      0x0001      // Private msgs allowed
  409. #define MA_PUB      0x0002      // Public msgs allowed
  410. #define MA_HIBIT    0x0004      // High bit msgs allowed
  411.  
  412. #define MA_NET      0x0008      // Netmail area
  413. #define MA_ECHO     0x0010      // Echomail area
  414. #define MA_CONF     0x0020      // Conference area
  415.  
  416. #define MA_ANON     0x0040      // Anonymous messages are OK
  417. #define MA_NORNK    0x0080      // Don't use the REALNAME kludge for this area
  418. #define MA_REAL     0x0100      // Force  use of       real name for this area
  419. #define MA_ALIAS    0x0200      // Force  use of alias      name for this area
  420. #define MA_AUDIT    0x0400      // Use auditing (msg tracking) controls in area
  421. #define MA_READONLY 0x0800      // Area is read-only
  422. #define MA_HIDDN    0x1000      // Area does not display on normal area list
  423. #define MA_ATTACH   0x2000      // Area allows local file attaches
  424.  
  425. // For marea.type:
  426.  
  427. #define MSGTYPE_SDM      1      // Area is *.MSG-type
  428. #define MSGTYPE_SQUISH   2      // Area is Squish-type
  429.  
  430. struct _marea                   // Information about current msg area
  431. {
  432.   string: name;                 // Area name
  433.   string: descript;             // Area description
  434.   string: path;                 // Area path
  435.   string: tag;                  // Area echo tag (if any)
  436.   string: attachpath;           // Path override for file attaches
  437.   string: barricade;            // Barricade file
  438.   int:    division;             // Non-zero means this is a file division (1=begin,2=end)
  439.   int:    type;                 // Message base type
  440.   int:    attribs;              // Area attributes
  441. };
  442.  
  443. #define FA_SLOW     0x0001      // Slow-access medium: skip existence checks
  444. #define FA_STAGED   0x0002      // Used staged transfer area for downloads
  445. #define FA_NONEW    0x0004      // Permanent storage - skip for new file checks
  446. #define FA_HIDDN    0x0008      // Area does not display on normal area list
  447. #define FA_DIVBEGIN 0x4000      // A file area division, not a real area
  448. #define FA_DIVEND   0x8000      // End of file area division
  449. #define FA_AUTODATE 0x0010      // Auto-date override
  450. #define FA_MANDATE  0x0020      // Manual date override
  451. #define FA_MANSIZE  0x0040      // Manual size override
  452. #define FA_FREETIME 0x0100      // Free download time for all files
  453. #define FA_FREESIZE 0x0200      // Free download bytes for all files
  454.  
  455. struct _farea                   // Information about current file area
  456. {
  457.   string: name;                 // Area name
  458.   string: descript;             // Area description
  459.   string: downpath;             // Download path
  460.   string: uppath;               // Upload path
  461.   string: filesbbs;             // Path to files list
  462.   string: barricade;            // Path to barricade file
  463.   int:    division;             // Non-zero means this is a file division (1=begin,2=end)
  464.   int:    attribs;              // Area attributes
  465. };
  466.  
  467. struct _usr                     // Information about current user
  468. {
  469.   string: name;                 // Caller's name
  470.   string: city;                 // Callers city and state/province
  471.   string: alias;                // User's alias
  472.   string: phone;                // User's phone number
  473.   unsigned int: lastread_ptr;   // Offset in LASTREAD.BBS/areaname.SQL
  474. //int:    time_remain;          // Time left for current call
  475.   string: pwd;                  // User's password
  476.   unsigned int:    times;       // Number of previous calls to system
  477.   char:   help;                 // Help level.  Novice=6, regular=4,
  478.                                 // expert=2, hotflash=32.
  479.   char:   video;                // Video mode.  0=tty, 1=ansi, 2=avatar
  480.   char:   nulls;                // Number of NULs (delays) after <cr>
  481.  
  482.   // Bits 1:
  483.  
  484.   char:   hotkeys;              // 1 = Hotkeys enabled
  485.   char:   notavail;             // 1 = Not available for chat
  486.   char:   fsr;                  // 1 = Full-screen reader is enabled
  487.   char:   nerd;                 // 1 = User is a nerd (cannot yell)
  488.   char:   noulist;              // 1 = User does not show in userlist
  489.   char:   tabs;                 // 1 = User can handle tab characters
  490.   char:   encrypted;            // 1 = User's password is encrypted
  491.   char:   rip;                  // 1 = User has RIP graphics turned on
  492.  
  493.   // Bits 2:
  494.  
  495.   char:   badlogon;             // 1 = Last logon attempt was bad
  496.   char:   ibmchars;             // 1 = User can handle IBM characters
  497.   char:   bored;                // 1 = BORED.  0 = MaxEd
  498.   char:   more;                 // 1 = More prompt enabled
  499.   char:   configured;           // 1 = City/pwd fields have been filled
  500.   char:   cls;                  // 1 = User can handle clearscreen
  501.  
  502.   unsigned int: priv;           // User's priv level.
  503.  
  504.   string: dataphone;            // User's data phone number
  505.   unsigned int: time;           // Length of time user has been on-line
  506.                                 // today.
  507.  
  508.   // Delflag
  509.  
  510.   char:   deleted;              // This user has been deleted.
  511.   char:   permanent;            // This user is permanent.
  512.  
  513. //long:   baud;
  514.   long:   msgs_posted;          // Number of messages posted
  515.   long:   msgs_read;            // Number of messages read
  516.  
  517.   char:   width;                // Width of caller's screen
  518.   char:   len;                  // Height of caller's screen
  519.  
  520.   unsigned int: credit;         // Netmail credit, in cents
  521.   unsigned int: debit;          // Netmail debit, in cents
  522.  
  523.   // Expiration controls
  524.  
  525.   unsigned int: xp_priv;        // Demote user to this priv when
  526.                                 // subscription expires.  (Same encoding
  527.                                 // as usr.priv)
  528.  
  529.   struct _stamp: xp_date;       // If it is past this date, the user has
  530.                                 // expired.
  531.  
  532.   unsigned long: xp_mins;       // The user has this many minutes left
  533.                                 // before expiring.
  534.  
  535.   // XPflag
  536.  
  537.   char:   expdate;              // 1 = Expire based on date in xp_date
  538.   char:   expmins;              // 1 = Expire based on time in xp_mins
  539.   char:   expdemote;            // 1 = When expired, demote to xp_priv
  540.   char:   expaxe;               // 1 = When expired, hang up
  541.  
  542.   char:   sex;                  // User's sex.  See SEX_xxx definitions
  543.  
  544.   struct _stamp: ludate;        // Date of user's last call
  545.  
  546.   string: xkeys;                // User's keys, as a string
  547.  
  548.   char:   lang;                 // User's current language. 0=first lang,
  549.                                 // 1=second lang, etc.
  550.  
  551.   char:   def_proto;            // User's default protocol.  See the
  552.                                 // PROTOCOL_xxx definitions above.
  553.                                 // Positive numbers indicate external
  554.                                 // protocols.
  555.  
  556.   unsigned long: up;            // Kilobytes uploaded, for all calls
  557.   unsigned long: down;          // Kilobytes downloaded, for all calls
  558.   unsigned long: downtoday;     // Kilobytes downloaded today
  559.  
  560.   string: msg;                  // Current message area
  561.   string: files;                // Last message area
  562.  
  563.   char:   compress;             // Default compression program
  564.   string: dob;                  // Caller's date of birth,
  565.                                 // stored in format yy.mm.dd
  566.                                 // eg. 74.03.24
  567.  
  568.   struct _stamp: date_1stcall;  // Date of user's first call
  569.   struct _stamp: date_pwd_chg;  // Date of user's last pwd change
  570.  
  571.   unsigned long: nup;           // Number of files uploaded
  572.   unsigned long: ndown;         // Number of files downloaded (total)
  573.   unsigned long: ndowntoday;    // Number of files downloaded (today)
  574.  
  575.   unsigned int: time_added;     // Time credits for today
  576.  
  577.   unsigned long: point_credit;  // Total number of point credits
  578.   unsigned long: point_debit;   // Total number of point debits
  579.  
  580.   struct _stamp: date_newfile;  // Date of last new-files search
  581.  
  582.   unsigned int: call;           // Number of previous calls today
  583.  
  584. };
  585.  
  586.  
  587. // Session data exported by Max:
  588.  
  589. struct _instancedata
  590. {
  591.   int:  instant_video;            // Status of "instant video"
  592.   unsigned int: task_num;         // Our task number
  593.   int:  local;                    // Is the user a local caller?
  594.   int:  port;                     // COM port number (OS/2: com handle)
  595.   unsigned long: speed;           // User's baud rate
  596.   int:  alias_system;             // Is this an alias system?
  597.   int:  ask_name;                 // Ask for user's real name?
  598.   int:  use_umsgid;               // Uses umsgid's rather than msg numbers
  599. };
  600.  
  601.  
  602. // Used with filefindfirst()
  603. #define FA_NORMAL   0x00
  604. #define FA_READONLY 0x01
  605. #define FA_HIDDEN   0x02
  606. #define FA_SYSTEM   0x04
  607. #define FA_VOLUME   0x08
  608. #define FA_SUBDIR   0x10
  609. #define FA_ARCHIVE  0x20
  610.  
  611. // Used by set_output()
  612. #define DISABLE_NONE    0
  613. #define DISABLE_LOCAL   1
  614. #define DISABLE_REMOTE  2
  615. #define DISABLE_BOTH    3
  616.  
  617. struct _ffind
  618. {
  619.     long:           finddata;
  620.     string:         filename;
  621.     unsigned long:  filesize;
  622.     struct _stamp:  filedate;
  623.     unsigned int:   fileattr;
  624. };
  625.  
  626. #define CALL_LOGON      0x8000       // Caller was logged on!
  627. #define CALL_CARRIER    0x0001       // Caller lost carrier
  628. #define CALL_EJECTED    0x0002       // Caller was ejected by sysop or priv
  629. #define CALL_PAGED_AH   0x0004       // Caller paged after hours
  630. #define CALL_DLEXCEED   0x0008       // Caller attempted to exceed d/l
  631. #define CALL_EXPIRED    0x0010       // Caller's subscription expired
  632. #define CALL_TIMELIMIT  0x0020       // Caller exceeded time limit
  633. #define CALL_NERD       0x0040       // Caller was nerd'ed
  634. #define CALL_BARRPWD    0x0080       // Barricade password failure
  635.  
  636. struct _callinfo
  637. {
  638.   string: name;
  639.   string: city;
  640.   struct _stamp: login;
  641.   struct _stamp: logoff;
  642.   int: task;
  643.   unsigned int: flags;
  644.   unsigned int: logon_priv;
  645.   string: logon_xkeys;
  646.   unsigned int: logoff_priv;
  647.   string: logoff_xkeys;
  648.   unsigned int: filesup;
  649.   unsigned int: filesdn;
  650.   unsigned int: kbup;
  651.   unsigned int: kbdn;
  652.   unsigned int: calls;
  653.   unsigned int: read;
  654.   unsigned int: posted;
  655.   unsigned int: paged;
  656.   int: added;
  657. };
  658.  
  659.  
  660. // GLOBAL DATA
  661.  
  662. string: input;                  // Current stacked input string
  663. struct _instancedata: id;       // Information about current session
  664. struct _marea: marea;           // Message area information
  665. struct _farea: farea;           // File area information
  666. struct _msg: msg;               // Current message information
  667. struct _usr: usr;               // User record
  668. struct _sys: sys;               // System information
  669.  
  670.  
  671. // Static data functions
  672.  
  673. int create_static_data(string: key, long: size);
  674. int get_static_data(string: key, ref void: data);
  675. int set_static_data(string: key, ref void: data);
  676. int destroy_static_data(string: key);
  677.  
  678. // Static string functions
  679.  
  680. int create_static_string(string: key);
  681. int get_static_string(string: key, ref string: data);
  682. int set_static_string(string: key, string: data);
  683. int destroy_static_string(string: key);
  684.  
  685. // Miscellaneous functions:
  686.  
  687. int vidsync();
  688. int shell(int: method, string: cmd);
  689. void sleep(int: duration);
  690. void log(string: s);
  691. long class_info(int: priv, int: CIT);
  692. int privok(string: privstr);
  693. string class_abbrev(int: priv);
  694. string class_name(int: priv);
  695. string class_loginfile(int: priv);
  696. unsigned int class_to_priv(string: s);
  697. int set_output(int: where);
  698. unsigned int term_length();
  699. unsigned int term_width();
  700. unsigned int screen_length();
  701. unsigned int screen_width();
  702.  
  703. // Time-related functions
  704.  
  705. unsigned long time();
  706. unsigned long timeon();
  707. unsigned long timeleft();
  708. long timeadjust(long: delta);
  709. long timeadjustsoft(long: delta);
  710. void timestamp(ref struct _stamp: stamp);
  711. string stamp_string(ref struct _stamp: stamp);
  712. unsigned long stamp_to_long(ref struct _stamp: st);
  713. void long_to_stamp(long: time, ref struct _stamp: st);
  714.  
  715.  
  716. // Miscellaneous Maximus-related commands
  717.  
  718. string protocol_num_to_name(char: pnum);
  719. string compressor_num_to_name(char: cnum);
  720. string language_num_to_name(char: lnum);
  721. int chat_querystatus(ref struct _cstat: cstat);
  722. string prm_string(int: stringnum);
  723.  
  724. // Functions for activating menu commands and displaying MECCA files.
  725.  
  726. void menu_cmd(int: cmdnum, string: args);
  727. int display_file(string: filename, ref char: nonstop);
  728.  
  729. // File areas:  download-related functions
  730.  
  731. int tag_queue_file(string: filename, int: flags);
  732. int tag_dequeue_file(int: posn);
  733. int tag_queue_size();
  734. int tag_get_name(int: posn, ref int: flags, ref string: filename);
  735.  
  736.  
  737. // Input functions
  738.  
  739. char getch();
  740. char kbhit();
  741. char localkey();
  742. int input_str(ref string: s, int: type, char: ch, int: max, string: prompt);
  743. int input_ch(int: type, string: options);
  744. int input_list(string: list, int: type, string: help_file,
  745.                string: invalid_response, string: prompt);
  746.  
  747.  
  748. // "More [Y,n]"-related commands
  749.  
  750. void reset_more(ref char: nonstop);
  751. int do_more(ref char: nonstop, string: colour);
  752.  
  753. // String functions
  754.  
  755. unsigned int strlen(string: s);
  756. int strtoi(string: s);
  757. long strtol(string: s);
  758. string itostr(int: i);
  759. string ltostr(long: l);
  760. string uitostr(unsigned int: ui);
  761. string ultostr(unsigned long: ul);
  762. int strfind(string: str, string: substring);
  763. int stridx(string: str, int: startpos, int: ch);
  764. int strridx(string: str, int: startpos, int: ch);
  765. string strpad(string: str, int: length, char: pad);
  766. string strpadleft(string: str, int: length, char: pad);
  767. string substr(string: s, int: pos, int: length);
  768. string strtok(string: src, string: toks, ref int: pos);
  769. string strupper(string: s);
  770. string strlower(string: s);
  771. string strtrim(string: s, string: x);
  772.  
  773. // File I/O functions:
  774.  
  775. int  open    (string: name, int: mode);
  776. int  read    (int: fd, ref string: s, int: len);
  777. int  readln  (int: fd, ref string: s);
  778. int  write   (int: fd, ref string: s, int: len);
  779. int  writeln (int: fd, string: s);
  780. long tell    (int: fd);
  781. long seek    (int: fd, long: pos, int: where);
  782. int  close   (int: fd);
  783.  
  784. // I/O functions
  785.  
  786. void print(...);
  787. int __printSTRING(string: s);
  788. int __printINT(int: i);
  789. int __printLONG(long: l);
  790. int __printCHAR(char: c);
  791. int __printUNSIGNED_INT(int: i);
  792. int __printUNSIGNED_LONG(long: l);
  793. int __printUNSIGNED_CHAR(char: c);
  794.  
  795. int ansi_detect();
  796. int rip_detect();
  797.  
  798. // Local keyboard state
  799.  
  800. int keyboard(int: state);
  801. int iskeyboard();
  802. int snoop(int: state);
  803. int issnoop();
  804.  
  805. // RIP helper functions
  806.  
  807. void set_textsize(int: cols, int: rows);
  808. int rip_send(string: filename, int: display);
  809. int rip_hasfile(string: filename, ref long: filesize);
  810.  
  811. // Area search related
  812.  
  813. #define AFFO_NODIV  0
  814. #define AFFO_DIV    1
  815.  
  816. int fileareafindprev(ref struct _farea: fa);
  817.  
  818. int fileareafindfirst(ref struct _farea: fa, string: name, int: flags);
  819. int fileareafindnext(ref struct _farea: fa);
  820. void fileareafindclose();
  821. int fileareaselect(string: name);
  822.  
  823. void file_area();
  824.  
  825. int msgareafindprev(ref struct _marea: ma);
  826.  
  827. int msgareafindfirst(ref struct _marea: ma, string: name, int: flags);
  828. int msgareafindnext(ref struct _marea: ma);
  829. void msgareafindclose();
  830. int msgareaselect(string: name);
  831.  
  832. void msg_area();
  833.  
  834. // Filesystem related
  835.  
  836. int rename(string: oldname, string: newname);
  837. int remove(string: filename);
  838. int filecopy(string: fromname, string: toname);
  839. int fileexists(string: filename);
  840. long filesize(string: filename);
  841. int filedate(string: filename, ref struct _stamp: filedate);
  842.  
  843. int filefindfirst(ref struct _ffind: ff, string: filename, int: attribs);
  844. int filefindnext(ref struct _ffind: ff);
  845. void filefindclose(ref struct _ffind: ff);
  846.  
  847. // Caller file
  848.  
  849. int call_open();
  850. void call_close();
  851. long call_numrecs();
  852. int call_read(long: recno, ref struct _callinfo: ci);
  853.  
  854. // User file
  855.  
  856. int userfindopen(string: name, string: alias, ref struct _usr: u);
  857. int userfindnext(ref struct _usr: u);
  858. int userfindprev(ref struct _usr: u);
  859. void userfindclose();
  860.  
  861. long userfilesize();
  862. int userupdate(ref struct _usr: u, string: origname, string: origalias);
  863. int usercreate(ref struct _usr: u);
  864. int userremove(ref struct _usr: u);
  865. int userfindseek(long: rec, ref struct _usr: u);
  866.  
  867. // Special & modem support
  868.  
  869. int time_check(int: state);
  870. void chatstart();
  871. int dcd_check(int: state);
  872. int mdm_command(string: cmdstring);
  873. void mdm_flow(int: state);
  874. int carrier();
  875. long xfertime(int: protocol, long: bytes);
  876.  
  877.